package cc.eddic.pratice.programmingparadigms;

import lombok.ToString;

/**
 * 统计结果
 */
@ToString
public class Result {
    public Result(String key) {
        this.key = key;
        this.count = 1;
    }

    public Result(String key, int count) {
        this.key = key;
        this.count = count;
    }

    /**
     * 统计的键值
     */

    private String key;

    /**
     * 数量
     */
    private int count;


    public void setKey(String key) {
        this.key = key;
    }

    public void setCount(int value) {
        this.count = value;
    }

    public String getKey() {
        return key;
    }

    public int getCount() {
        return count;
    }

    /**
     * 自增 1
     */
    public void inc() {
        count++;
    }

    public void dec() {
        count--;
    }


}
